<template>
  <div>
    <h1>child</h1>
    <button @click="postMsg">传给父组件</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "河南变成了可南",
    };
  },
  methods: {
    postMsg() {
      this.$emit("parentHandler", this.msg);
    },
  },
  created() {
    this.$bus.$on("handler", (val) => {
      console.log(val);
    });
  },
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped></style>
